package com.example.xyxwebbackend001.service.impl;

import com.example.xyxwebbackend001.mapper.*;
import com.example.xyxwebbackend001.model.entity.*;
import com.example.xyxwebbackend001.model.vo.ComArtDetailsVO;
import com.example.xyxwebbackend001.model.vo.CommendListVO;
import com.example.xyxwebbackend001.service.RecommendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import java.util.Collections;
import java.util.List;

@Service
public class RecommendServiceImpl implements RecommendService {

    @Autowired
    private FoodMapper foodMapper;

    @Autowired
    private TradCraftMapper tradCraftMapper;

    @Autowired
    private TouristMapper touristMapper;

    @Autowired
    private EventCalendarMapper eventCalendarMapper;

    @Autowired
    private TodayRecommendMapper todayRecommendMapper;
    @Override
    public List<CommendListVO> getRecommendFoodList(String cityId) {
        return foodMapper.getFoodListByCityId(cityId);
    }

    @Override
    public ComArtDetailsVO getCommendFoodDetails(String foodId) {
        ComArtDetailsVO foodDetails = foodMapper.selectFoodDetailsById(foodId);
        return foodDetails;
    }

    @Override
    public List<CommendListVO> getRecommendTradCraftList(String cityId) {
        return tradCraftMapper.getTradCraftList(cityId);
    }

    @Override
    public ComArtDetailsVO getCommendTradCraftDetails(String tradCraftId) {
        ComArtDetailsVO tradCraftDetails = tradCraftMapper.selectTradCraftDetailsById(tradCraftId);
        return tradCraftDetails;
    }


    @Override
    public List<CommendListVO> getRecommendTouristList(String cityId) {
        return touristMapper.getTouristListByCityId(cityId);
    }

    @Override
    public ComArtDetailsVO getCommendTouristDetails(String touristId) {
        ComArtDetailsVO touristDetails = touristMapper.selectTouristDetailsById(touristId);
        return touristDetails;
    }

    @Override
    public List<EventCalendar> getRecommendEventCalendarList(String cityId) {
        return eventCalendarMapper.getEventCalendarByCityId(cityId);
    }

    @Override
    public List<TodayRecommend> getTodayRecommendList(String cityId) {
        return todayRecommendMapper.getTodayRecommendList(cityId);
    }
}
